import 'package:dio/dio.dart';
import 'package:p_location/utils/string_util.dart';
import 'net_listener.dart';

class HttpOption {
  String contentType;
  NetListener callback;
  CancelToken cancelToken;
  String savePathForDownload;
  String loadingTip;
  dynamic data;

  HttpOption(
      {this.contentType = 'application/json',
      this.callback,
      this.cancelToken,
      this.savePathForDownload,
      this.loadingTip,
      this.data});

  bool isValid() {
    if (StringUtil.isEmpty(contentType)) {
      print('contentType 不能为空');
      return false;
    }
    if (callback == null) {
      print('callback 不能为空');
      return false;
    }
    return true;
  }
}
